package com.nulldev.util.crypto.encryptAPI;

import com.nulldev.util.crypto.encryptAPI.aes.AESCipher;
import com.nulldev.util.crypto.encryptAPI.manage.Encryptor;

public class AES extends Encryptor {

	@Override
	public String getEncryptorID() {
		return "encryptAPI.AES_256";
	}

	@Override
	public String[] supportedEncryptors() {
		return new String[] {"AES", "AES_256"};
	}

	@Override
	public String encrypt(String text, String password) {
		final AESCipher cp = new AESCipher(password.getBytes());
		return cp.getEncryptedMessage(text);
	}

	@Override
	public String decrypt(String text, String password) {
		final AESCipher cp = new AESCipher(password.getBytes());
		return cp.getDecryptedMessage(text);
	}

	@Override
	public byte[] encryptBytes(byte[] data, String password) {
		final AESCipher cp = new AESCipher(password.getBytes());
		return cp.getEncryptedMessage(data);
	}

	@Override
	public byte[] decryptBytes(byte[] data, String password) {
		final AESCipher cp = new AESCipher(password.getBytes());
		return cp.getDecryptedMessage(data);
	}

}
